<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS三角制作</title>
    <style>
        .box1{
            width: 0;
            height: 0;
            /* border: 50px solid pink; */
            border-top: 50px solid pink;
            border-right:50px solid red;
            border-bottom: 50px solid blue;
            border-left: 50px solid green;
        }

        .box2{
            width: 0;
            height: 0;
            /* 照顾兼容性问题开始 (line-height、font-size为了照顾兼容性) */
            line-height: 0; 
            font-size: 0;
            /* 照顾兼容性问题结束 */
            border:50px solid transparent;
            border-top-color: pink;
            margin: 100px auto;
        }

        .box3{
            width: 0;
            height: 0;
             /* 照顾兼容性问题开始 (line-height、font-size为了照顾兼容性) */
            line-height: 0; 
            font-size: 0;
            /* 照顾兼容性问题结束 */
            border: 50px solid transparent;
            border-left-color: skyblue;
            margin: 100px auto;
        }

    </style>
</head>
<body>
    <div class="box1"></div>

    <!-- 向下的三角 -->
    <div class="box2"></div>
    <!-- 向右的三角 -->
    <div class="box3"></div>
</body>
</html>